﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using MySql.Data;
using MySql.Data.MySqlClient;
namespace DAL
{
    public class Articulo_DAL
    {


        public DataTable DATA_Articulo_Listar(String descripcion)
        {
            //Lista todas las especialidades de la tabla data_notas

            String cadena = "";
            Conexion conex = new Conexion();
            MySqlCommand Comnota3 = new MySqlCommand();
            MySqlDataAdapter adpnota3 = new MySqlDataAdapter();
            DataTable data = new DataTable();
            MySqlConnection conexion = new MySqlConnection();
            cadena = conex.ConexionCampusVirtual();

            conexion.ConnectionString = cadena;
            try
            {
                conexion.Open();
                Comnota3.CommandText = "sp_DATA_Articulo_Listar";
                Comnota3.CommandType = CommandType.StoredProcedure;
                Comnota3.Parameters.AddWithValue("@in_Descripcion", descripcion);

                Comnota3.Connection = conexion;

                adpnota3 = new MySqlDataAdapter(Comnota3);
                adpnota3.Fill(data);

                return data;

            }
            catch (Exception ex)
            {
                throw ex;

            }

            finally
            {
                Comnota3.Dispose();
                conexion.Close();
            }

        }


    }
}
